package com.zxy.demo.junit;

import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.JUnitCore;
import org.junit.runner.Result;
import org.junit.runner.notification.Failure;

/**
 * JUnitCoreDemo.
 * 
 * Created by zxybird on 17/5/15.
 */
public class JUnitCoreDemo {

  @Test
  public void test() {
    Assert.assertTrue(false);
  }

  public static void main(String[] args) {
    Result result = JUnitCore.runClasses(JUnitCoreDemo.class);  // RunTest即包含测试方法的类
    for (Failure failure : result.getFailures()) { // 对于执行失败的情况打印失败信息
      System.out.println(failure.toString());
    }
  }
}
